<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/webpage/include/taglib.jsp"%>
<html>
<head>
	<title>付款申请管理</title>
	<meta name="decorator" content="ani"/>
	<style type="text/css">
		._citys { width: 450px; display: inline-block; border: 1px solid #63B8FF; padding: 5px; position: relative;background-color: #C4C4C4; }
		._citys span { color: #424242; height: 15px; width: 15px; line-height: 15px; text-align: center; border-radius: 3px; position: absolute; right: 10px; top: 10px; border: 1px solid #56b4f8; cursor: pointer; }
		._citys0 { width: 100%; height: 34px; display: inline-block; border-bottom: 2px solid #56b4f8; padding: 0; margin: 0; background-color: #C4C4C4;}
		._citys0 li { display: inline-block; line-height: 34px; font-size: 15px; color: #888; width: 80px; text-align: center; cursor: pointer; }
		.citySel { background-color: #56b4f8; color: #424242 !important; }
		._citys1 { width: 100%; display: inline-block; padding: 10px 0; background-color: #C4C4C4;}
		._citys1 a { width: 83px; height: 35px; display: inline-block; background-color:#3B3B3B; color: #EED2EE; margin-left: 6px; margin-top: 3px; line-height: 35px; text-align: center; cursor: pointer; font-size: 13px; overflow: hidden; }
		._citys1 a:hover { color: #3B3B3B; background-color: #E0E0E0; }
		.AreaS { background-color: #FFC0CB  !important; color: #BC8F8F !important; }
	</style>
	<script type="text/javascript">
		var validateForm;
		var $table; // 父页面table表格id
		var $topIndex;//弹出窗口的 index
		function doSubmit(table, index){//回调函数，在编辑和保存动作时，供openDialog调用提交表单。
		  if(validateForm.form()){
			  $table = table;
			  $topIndex = index;
			  jp.loading();
			  $("#inputForm").submit();
			  return true;
		  }

		  return false;
		}

		$(document).ready(function() {
			validateForm = $("#inputForm").validate({
				submitHandler: function(form){
					jp.post("${ctx}/ap/paymentApplication/save",$('#inputForm').serialize(),function(data){
						if(data.success){
	                    	$table.bootstrapTable('refresh');
	                    	jp.success(data.msg);
	                    	jp.close($topIndex);//关闭dialog

	                    }else{
            	  			jp.error(data.msg);
	                    }
					})
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
			
	        $('#date').datetimepicker({
				 format: "YYYY-MM-DD HH:mm:ss"
		    });
	        $('#fkrq').datetimepicker({
				 format: "YYYY-MM-DD HH:mm:ss"
		    });
		});
	</script>
</head>
<body class="bg-white">
		<form:form id="inputForm" modelAttribute="paymentApplication" class="form-horizontal">
		<form:hidden path="id"/>
		<sys:message content="${message}"/>	
		<table class="table table-bordered">
		   <tbody>
				<tr>
					<td class="width-15 active"><label class="pull-right">部门：</label></td>
					<td class="width-35">
						<form:input path="bm" htmlEscape="false" readonly="true"   class="form-control "/>
					</td>
					<td class="width-15 active"><label class="pull-right">申请日期：</label></td>
					<td class="width-35">
						<p class="input-group">
							<div class='input-group form_datetime' id='date'>
			                    <input type='text'  name="date" class="form-control"  value="<fmt:formatDate value="${paymentApplication.date}" pattern="yyyy-MM-dd HH:mm:ss"/>"/>
			                    <span class="input-group-addon">
			                        <span class="glyphicon glyphicon-calendar"></span>
			                    </span>
			                </div>
			            </p>
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">申请人：</label></td>
					<td class="width-35">
						<form:input path="sqr" htmlEscape="false" readonly="true"   class="form-control "/>
					</td>
					<td class="width-15 active"><label class="pull-right">采购申请单据号：</label></td>
					<td class="width-35">
						<form:input path="cgdh" htmlEscape="false"    class="form-control "/>
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">费用类型：</label></td>
					<td class="width-35">
						<form:input path="type" htmlEscape="false"  id="city" autocomplete="off" class="form-control "/>
						<script>
                            $("#city").click(function (e) {
                                var province;
                                var area;
                                $.ajax({
                                    url:'${ctx}/ap/sub/getJson',
                                    async: false,
                                    success:function (data) {
                                        province=data;
                                    }
                                });
                                <%--$.ajax({--%>
                                <%--url:'${ctx}/ap/sub/getJson1',--%>
                                <%--async: false,--%>
                                <%--success:function (data) {--%>
                                <%--area=data;--%>
                                <%--}--%>
                                <%--});--%>
                                SelCity(this,e,province,area);
                            });
						</script>
					</td>
					<td class="width-15 active"><label class="pull-right">所附单据：</label></td>
					<td class="width-35">
						<form:select path="sfdj" class="form-control required">
							<form:options items="${fns:getDictList('invoice_type')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
						</form:select>
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">付款日期：</label></td>
					<td class="width-35">
						<p class="input-group">
							<div class='input-group form_datetime' id='fkrq'>
			                    <input type='text'  name="fkrq" class="form-control"  value="<fmt:formatDate value="${paymentApplication.fkrq}" pattern="yyyy-MM-dd HH:mm:ss"/>"/>
			                    <span class="input-group-addon">
			                        <span class="glyphicon glyphicon-calendar"></span>
			                    </span>
			                </div>
			            </p>
					</td>
					<td class="width-15 active"><label class="pull-right">原因用途：</label></td>
					<td class="width-35">
						<form:input path="yy" htmlEscape="false"    class="form-control "/>
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">项次：</label></td>
					<td class="width-35">
						<form:input path="xc" htmlEscape="false"    class="form-control "/>
					</td>
					<td class="width-15 active"><label class="pull-right">金额：</label></td>
					<td class="width-35">
						<form:input path="je" htmlEscape="false"    class="form-control "/>
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">费用归属：</label></td>
					<td class="width-35">
						<form:select path="fygs" class="form-control required">
							<form:options items="${fns:getDictList('guishu')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
						</form:select>
					</td>
					<td class="width-15 active"><label class="pull-right">备注：</label></td>
					<td class="width-35">
						<form:input path="bz" htmlEscape="false"    class="form-control "/>
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">发票类型：</label></td>
					<td class="width-35">
						<form:select path="fplx" class="form-control required">
							<form:options items="${fns:getDictList('invoice_type')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
						</form:select>
					</td>
					<td class="width-15 active"><label class="pull-right">单据号：</label></td>
					<td class="width-35">
						<form:input path="code" htmlEscape="false" readonly="true"   class="form-control "/>
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">付款单位：</label></td>
					<td class="width-35">
						<form:input path="fkdw" htmlEscape="false"    class="form-control "/>
					</td>
					<td class="width-15 active"><label class="pull-right">付款方式：</label></td>
					<td class="width-35">
						<form:select path="fkfs" class="form-control required">
							<form:options items="${fns:getDictList('pay_method_type')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
						</form:select>
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">收款人全称：</label></td>
					<td class="width-35">
						<form:input path="skr" htmlEscape="false"    class="form-control "/>
					</td>
					<td class="width-15 active"><label class="pull-right">开户银行：</label></td>
					<td class="width-35">
						<form:input path="khyh" htmlEscape="false"    class="form-control "/>
					</td>
				</tr>
				<tr>
					<td class="width-15 active"><label class="pull-right">银行账户：</label></td>
					<td class="width-35">
						<form:input path="yhzh" htmlEscape="false"    class="form-control "/>
					</td>
					<td class="width-15 active"><label class="pull-right">单据状态：</label></td>
					<td class="width-35">
						<form:input path="status" htmlEscape="false"  readonly="true"  class="form-control "/>
						<input type="hidden" name="pro" value="${paymentApplication.pro}"/>

					</td>
				</tr>
				<%--<tr>--%>
					<%--<td class="width-15 active"><label class="pull-right">项目：</label></td>--%>
					<%--<td class="width-35">--%>
						<%--<form:input path="pro" htmlEscape="false"    class="form-control "/>--%>
					<%--</td>--%>
					<%--<td class="width-15 active"></td>--%>
		   			<%--<td class="width-35" ></td>--%>
		  		<%--</tr>--%>
		 	</tbody>
		</table>
	</form:form>
</body>
</html>